<?php
/**
 * Autor:   Miguel A. Zilli
 * Email:   miguelzilli@gmail.com
 */

class Asesoramiento extends AppModel {
    var $name = 'Asesoramiento';
    var $useTable = 'asesoramientos';
    var $primaryKey = 'id';
    var $displayField = 'tipo_ases';
    var $recursive = 0;
    var $order=array(
        'Asesoramiento.tipo_ases'=>'ASC'
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed
    var $belongsTo = array(
        'Revision' => array(
            'className' => 'Revision',
            'foreignKey' => 'revision_id'
        ),
        'Asesor'=>array(
            'className'=>'Asesor',
            'foreignKey'=>'asesor_id'
        )
    );

    public function beforeSave(){
        if(!empty($this->data['Asesoramiento'])){
            foreach($this->data['Asesoramiento'] as $campo=>$valor){
                $this->data['Asesoramiento'][$campo]=strtoupper($valor);
            }
        }
        return true;
    }
}
?>